package com.xuxin.baby.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.xuxin.baby.R;
import com.xuxin.baby.glide.GlideApp;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xu_xin
 * Created on 2020.08.04 0004
 * 成长日志
 */
public class MainRecordAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public MainRecordAdapter() {
        super(R.layout.item_main_record);
        List<String> list = new ArrayList<>();
        list.add("记身高体重头围");
        list.add("记睡眠");
        list.add("记臭臭");
        list.add("记喂养");
        list.add("记看病");
        list.add("记疫苗");
        list.add("大事记");
        setNewInstance(list);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, String item) {
        ImageView item_main_record_image = holder.getView(R.id.item_main_record_image);
        holder.setText(R.id.item_main_record_name, item);
        switch (item) {
            case "记身高体重头围":
                GlideApp.with(getContext()).load(R.mipmap.img_record_height).centerCrop().into(item_main_record_image);
                break;
            case "记睡眠":
                GlideApp.with(getContext()).load(R.mipmap.img_record_sleep).centerCrop().into(item_main_record_image);
                break;
            case "记臭臭":
                GlideApp.with(getContext()).load(R.mipmap.img_record_smelly).centerCrop().into(item_main_record_image);
                break;
            case "记喂养":
                GlideApp.with(getContext()).load(R.mipmap.img_record_feed).centerCrop().into(item_main_record_image);
                break;
            case "记看病":
                GlideApp.with(getContext()).load(R.mipmap.img_record_sickness).centerCrop().into(item_main_record_image);
                break;
            case "记疫苗":
                GlideApp.with(getContext()).load(R.mipmap.img_record_vaccines).centerCrop().into(item_main_record_image);
                break;
            case "大事记":
                GlideApp.with(getContext()).load(R.mipmap.img_record_event).centerCrop().into(item_main_record_image);
                break;
        }
    }
}